<?php
if(!empty($_GET['ref_id']))
{
  $sendto = encrypt($_SERVER['REQUEST_URI'],'1b2u3z4z5r6');
  $link = get_bloginfo('wpurl')."/wp-content/plugins/buzzr_invite/invite.php?sendto=".$sendto;
  header("Location: $link");
}
?>
<?php thematic_create_doctype(); echo " "; language_attributes(); echo ">\n";?>
<head profile="http://gmpg.org/xfn/11">

<script type="text/javascript">

//JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com)
//Visit JavaScriptKit.com for free JavaScripts
//This notice must stay intact for legal use
//Win Type: Pop Up | Session Only
    
//Specify URLs to randomly select from and popup/popunder:
//To display a single URL, just remove all but the first entry below:
var popurls=new Array()
popurl="http://buzzr.in/wordpress/invite-popup.php"

function openpopup(popurl){
var winpops=window.open(popurl,"","width=700,height=470")
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function loadornot(){
if (get_cookie('jkpopup')==''){
//openpopup(popurls[Math.floor(Math.random()*(popurls.length))])
delay = 15;
timer = setTimeout("openpopup(popurl)", delay*1000);
document.cookie="jkpopup=yes"
}
}

loadornot()
</script>

<link rel="icon" type="image/png" href="<?php echo get_bloginfo('wpurl'); ?>/wp-content/uploads/2010/08/favicon.ico">
<?php 
global $pods;
if(isset($pods->data['meta_title'])){ ?>
<title><?php echo ($pods->data['meta_title'].' | '.get_bloginfo('name')); ?></title>
<meta property="og:title" content="<?php echo ($pods->data['meta_title']); ?>" />
<?php
} else {
// normal title code here
thematic_doctitle();
}
thematic_create_contenttype();
thematic_show_description();
//thematic_show_robots();
thematic_canonical_url();
thematic_create_stylesheet();
thematic_show_rss();
thematic_show_commentsrss();
thematic_show_pingback();
thematic_show_commentreply();
wp_head();
//start custom stylesheet embed
// Get the last parameter from the URI (which happens to be the ID)
$iscampaignpage=pods_url_variable(-2);
if ($iscampaignpage == 'deals'){
$id = pods_url_variable('last');
$Record = new Pod('deal', $id);
$theme=$Record->get_field('theme.name');
//end custom stylesheet embed
}
else
{
$theme='Default';
}
if ($theme!=='Default'){
?>
<link rel="stylesheet" type="text/css" href="<?php echo get_bloginfo('stylesheet_url'); ?>" />
<?php
}

if(is_page('home'))
{
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>

<script type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/easyslider1.7/js/easySlider1.7.js"></script>
<!--slider script-->
<script type="text/javascript">
jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function

	$(document).ready(function(){
		$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
	});
});
</script>
<!--end slider script-->
<?php
}
?>

<meta property="fb:admins" content="500296642" />
</head>
<body class="<?php thematic_body_class() ?>">

<?php thematic_before(); ?>

<div id="wrapper" class="hfeed">

<?php thematic_aboveheader(); ?>   

<div id="header">

<?php thematic_header() ?>        

</div><!-- #header-->
    
<?php thematic_belowheader(); ?>

<?php
if(is_front_page())
{
  echo '<div id="main" style="background: none;">';
}
else
{
  echo '<div id="main">';
}
?>